﻿using Abp.Domain.Repositories;
using NetCore.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace NetCore.Interfaces
{
    /// <summary>
    /// Repository扩展 支持批量插入 项目中就直接使用INetCoreRepository
    /// </summary>
    /// <typeparam name="TEntity">实体</typeparam>
    /// <typeparam name="TPrimaryKey">实体主键类型</typeparam>
    public interface INetCoreRepository<TEntity, TPrimaryKey>
        : IRepository<TEntity, TPrimaryKey>
        where TEntity : BaseEntity<TPrimaryKey>//class, IEntity<TPrimaryKey>//
    {

        #region SqlServer Bulk

        /// <summary>
        /// sqlserver 批量插入
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        Task BulkInsertAsync(IList<TEntity> entities);

        /// <summary>
        /// sqlserver 批量删除
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        Task BulkDeleteAsync(IList<TEntity> entities);

        #endregion


        #region PostgreSQL Bulk

        /// <summary>
        /// Messaia.Net.PostgreSQL.BulkExtensions 批量插入
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        void PostgreBulkInsert(IEnumerable<TEntity> entities);

        #endregion
    }


    public interface INetCoreRepository<TEntity> : INetCoreRepository<TEntity, int>
        where TEntity : BaseEntity//class, IEntity<int>//
    {

    }

}
